<%--
    Document   : cadContrato
    Created on : 11/03/2011, 15:36:13
    Author     : Uptech
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!-- Declaração das Tags da biblioteca RichFaces -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
     <style>.cols{
            vertical-align:top;
        }
    </style>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/estilomodelo.css" rel="stylesheet" type="text/css" />
        <title>CADASTRO DE SUPRIMENTOS | Sistema Gestão de Suprimentos - SGS 1.0</title>
    </head>
<body>
<div id="container">
<div id="banner"></div>
<div  id="conteudoCad">
   <a4j:form id="formContrato">
    <rich:panel style="width:756px; height:216px; background-color:#FFFFFF;">
        <f:facet name="header">
            <h:outputText value="Edição de Contrato"/>
        </f:facet>
         <h:panelGrid columns="3">
            <h:outputText  value="Contrato: "/>
            <h:inputText id="contrato" value="#{ObjFacadeContrato.contrato.objeto}" required="true" size="20"/>
            <h:message showDetail="true "for="contrato"/>

            <h:outputText value="Valor: "/>
            <h:inputText id="valor" value="#{ObjFacadeContrato.contrato.valor}" required="true" size="20"/>
            <h:message for="valor"/>

            <h:outputText value="Inicio: "/>
            <rich:calendar id="inicio" datePattern="dd/MM/yyyy" required="true" cellWidth="24px" cellHeight="22px" style="width: 200px" value="#{ObjFacadeContrato.contrato.inicio}" />
            <rich:message for="inicio"/>

            <h:outputText value="Termino: "/>
            <rich:calendar id="termino" datePattern="dd/MM/yyyy" cellWidth="24px" required="true" cellHeight="22px" style="width: 200px" value="#{ObjFacadeContrato.contrato.termino}" />
            <rich:message for="termino"/>

             <a4j:commandButton value="Alterar" action="#{ObjFacadeContrato.alterarContrato}" />
            <a4j:commandButton value="Cancelar" action="#{ObjFacadeContrato.cancelaContrato}" />
        </h:panelGrid>

      </rich:panel>
    </a4j:form>
</div>
<div align="center" id="tableCad">
      <h:form>
          <rich:dataTable style="width:740px;" id="contrato" border="1" value="#{ObjDAO.allContrato}" rendered="#{not empty ObjDAO.allContrato}"  var="c" rows="4">         
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Contrato"/>
              </f:facet>
               <center> <h:outputText value="#{c.objeto}"/></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Valor"/>
              </f:facet>
               <center> <h:outputText value="#{c.valor}"/></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Inicio"/>
              </f:facet>
               <center><h:outputText  value="#{c.inicio}">
               <f:convertDateTime pattern="dd/MM/yyyy"/>
               </h:outputText></center>
          </h:column>
           <h:column>
              <f:facet name="header">
                  <h:outputText value="Termino"/>
              </f:facet>
               <center> <h:outputText value="#{c.termino}">
               <f:convertDateTime pattern="dd/MM/yyyy"/>
               </h:outputText></center>
          </h:column>       
              <f:facet name="footer">
                  <rich:datascroller />
              </f:facet>
      </rich:dataTable>
      </h:form>
  </div>
<div id="rodape"/>
</div>
</body>
</html>

</f:view>
